<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
        <h1><a href="../default.html">返回主页</a></h1>
     <script>
       var a=[12,89,100,1,45,752,64];
       document.write('排序前的数组为'+a);                                                                                                                                                                                                                                                                                                                                                                                                                    
       for(var i=1;i<a.length;i++){
        for(var j =0;j<=a.length;j++){
            if(a[j]>a[j+1]){
                [a[j],a[j+1]]=[a[j+1],a[j]];
            }
        }
       }
       document.write('排序后的数组为'+a);
     </script>
</body>
</html>